Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Modelica Tough coupling user guide #3696

Open
wants to merge 47 commits into
base: master
Choose a base branch
from

Conversation

JayHuLBL
Copy link
Contributor

No description provided.

@JayHuLBL JayHuLBL self-assigned this Mar 11, 2024
@JayHuLBL
Copy link
Contributor Author

@EttoreZ Would you please take another look at the changes?

@EttoreZ
Copy link
Contributor

EttoreZ commented Mar 11, 2024

Hey @JayHuLBL just two quick comments:

  • In the doStep description of the UserGuide. I would comment/remove this line: os.system("./writeincon < writeincon.inp") and uncomment this line # write_incon(), and also remove this line os.system(" ./readsave < readsave.inp > out.txt") and uncomment this line # readsave(). This is because the Python script now does not rely on the Fortran utility programs anymore.
  • The second comment is also related to that. In the diagram where you show the workflow of the Python script, writeincon and readsave are cited as utility programs. I would change that to Python functions.
    Apart from those, everything else looks good to me.

@JayHuLBL
Copy link
Contributor Author

@EttoreZ Thanks for the comments. I just addressed it. Please double-check.

@EttoreZ
Copy link
Contributor

EttoreZ commented Mar 12, 2024

@JayHuLBL the changes look good to me.

@JayHuLBL JayHuLBL requested a review from mwetter December 11, 2024 18:31
@JayHuLBL
Copy link
Contributor Author

@mwetter It's ready for your review.

Copy link
Member

@mwetter mwetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do one more revision.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must not assume that an installation has write access to the directory where the Buildings library is installed.

Moreover, doStep uses:

    modelicaWorkingPath = os.getcwd()
    py_dir = os.path.join(modelicaWorkingPath,'Resources/Python-Sources')

so we cannot assume the temporary directory is this one.

def doStep(dblInp, state):

modelicaWorkingPath = os.getcwd()
py_dir = os.path.join(modelicaWorkingPath,'Resources/Python-Sources')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work if the working directory is not Buildings.

# conditions for TOUGH simulation.
# This temporary folder should be created in advance before calling this
# python script.
tou_tmp = os.path.join(py_dir, 'toughTemp')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python has a way to determine the name of a temporary directory. Why don't we use it?

tou_tmp = os.path.join(py_dir, 'toughTemp')

# Heat flux from borehole wall to ground: Modelica --> Tough
Q = dblInp[:10]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the 10, and how does it relate to the Modelica sizes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable names in this figure must be the same as the Modelica variable names.
Also, Modelica is never written as MODELICA in any documentation (and in fact, it is written as Modelica in the borehole figure.
Go through the documentation as check for consistency.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the name TOUGHResponse and not just TOUGH?
We also don't use EnergyPlus_9_6_0Response or Python_xxx_Response.

<p>
This package contains models demonstrating the coupling between Modelica simulation
and <a href=\"https://tough.lbl.gov/software/tough3\">TOUGH</a> simulation.
Note that to run the coupled simulation, the TOUGH simulator should be installed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"should" it be installed, or "must" it be installed? "Should" is not sufficient.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This user guide lacks structure. It needs to be restructured to give a logical flow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening this file in OMEdit gives an error message due to a wrong annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants